package leetcode.code1701;

public class Solution extends Solution1701 {

	@Override
	public double averageWaitingTime(int[][] customers) {
		int start = 0;
		int Len = customers.length;
		double wait = 0;
		for (int i = 0; i < Len; i++) {
			int arrivali = customers[i][0];
			start = Math.max(start, arrivali);
			start += customers[i][1];
			wait += start - arrivali;
		}
		return wait / Len;
	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
